package tv.danmaku.ijk.media.player.misc;

import android.text.TextUtils;
import tv.danmaku.ijk.media.player.IjkMediaMeta.IjkStreamMeta;

public class IjkTrackInfo implements ITrackInfo {
    private IjkStreamMeta mStreamMeta;
    private int mTrackType;

    public IjkTrackInfo(IjkStreamMeta arg2) {

        this.mTrackType = 0;
        this.mStreamMeta = arg2;
    }

    public IMediaFormat getFormat() {
        return new IjkMediaFormat(this.mStreamMeta);
    }

    public String getInfoInline() {
        StringBuilder v0 = new StringBuilder(128);
        switch(this.mTrackType) {
            case 1: {
                v0.append("VIDEO");
                v0.append(", ");
                v0.append(this.mStreamMeta.getCodecShortNameInline());
                v0.append(", ");
                v0.append(this.mStreamMeta.getBitrateInline());
                v0.append(", ");
                v0.append(this.mStreamMeta.getResolutionInline());
                break;
            }
            case 2: {
                v0.append("AUDIO");
                v0.append(", ");
                v0.append(this.mStreamMeta.getCodecShortNameInline());
                v0.append(", ");
                v0.append(this.mStreamMeta.getBitrateInline());
                v0.append(", ");
                v0.append(this.mStreamMeta.getSampleRateInline());
                break;
            }
            case 3: {
                v0.append("TIMEDTEXT");
                break;
            }
            case 4: {
                v0.append("SUBTITLE");
                break;
            }
            default: {
                v0.append("UNKNOWN");
                break;
            }
        }

        return v0.toString();
    }

    public String getLanguage() {
        String v0 = this.mStreamMeta == null || (TextUtils.isEmpty(this.mStreamMeta.mLanguage)) ? "und" : this.mStreamMeta.mLanguage;
        return v0;
    }

    public int getTrackType() {
        return this.mTrackType;
    }

    public void setMediaMeta(IjkStreamMeta arg1) {
        this.mStreamMeta = arg1;
    }

    public void setTrackType(int arg1) {
        this.mTrackType = arg1;
    }

    public String toString() {
        return this.getClass().getSimpleName() + '{' + this.getInfoInline() + "}";
    }
}

